<template>
	<!-- 	<image v-if="show&&src" :src="src" :mode="mode" :style="{width:width||'100%',height:height||'100%'}" @error="onErr">
	</image>
	<image v-else src="/static/null.png" :mode="mode" :style="{width:width||'100%',height:height||'100%'}"></image> -->
	<uv-image v-if="show&&src" :src="src" :mode="mode" :width="width||'100%'" :height="height||'100%'" @error="onErr">
	</uv-image>
	<uv-image v-else src="/static/anonymous.png" :mode="mode" :width="width||'100%'" :height="height||'100%'"></uv-image>
	<!-- 预览图片 -->
	<!-- 	<view class="w-full h-full position-fixed top-0 left-0">
		<uv-image :src="src" :mode="mode" width="750rpx" height="100%">
		</uv-image>
	</view> -->
</template>

<script setup lang="ts">
	/**
	 * 自定义图片
	 * @description 自定义图片组件
	 * @property {String} src 路径
	 * @property {String} width 宽
	 * @property {String} height 高
	 * @property {String} mode 填充模式
	 */
	import { onMounted, ref } from 'vue';

	const show = ref(true)
	const { src, width, height, mode } = defineProps({
		src: {
			type: String,
			default: () => ""
		},
		width: {
			type: String,
			default: () => ''
		},
		height: {
			type: String,
			default: () => ''
		},
		mode: {
			type: String,
			default: () => ""
		}
	})
	const onErr = () => {
		// show.value = false
	}
</script>

<style>

</style>